package day04;

import util.CookieUtil;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/removeCookie")
public class RemoveCookieServlet extends HttpServlet {


    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) {
        System.out.println("RemoveCookieServlet.service()");

        // Cookie cookie=new Cookie("username","");
        //
        // cookie.setMaxAge(0);
        //
        // response.addCookie(cookie);

        CookieUtil.removeCookie("username",response);

    }
}
